﻿@model IEnumerable<PlanesManager.Models.Flights>

@{
    ViewBag.Title = "Search";
}

<h2>Search Results</h2>
@if (String.IsNullOrEmpty(ViewBag.Message))
{
   <div class="alert alert-warning">@ViewBag.Message</div>
}
<form method="post" action="/Home/Book">
    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Departure_Date)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Arrival_Date)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Plane_ID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Route_ID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SeatPrice)
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Departure_Date)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Arrival_Date)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Plane_ID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Route_ID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SeatPrice)
                </td>
                <td><input type="radio" name="flight" value="@item.ID" /></td>
            </tr>
        }
    </table>
    <h2>Hotels</h2>
    <table class="table">
        <tr>
            <td>Name</td>
            <td>Price</td>
            <th></th>
        </tr>
        @foreach (var room in ViewBag.Rooms)
        {
            <tr>
                <td>@room.name</td>
                <td>@room.price</td>
                <td><input type="radio" name="room" value="@room.category_id"/></td>
            </tr>
        }
    </table>

    <h2>Cars</h2>
    <table class="table">
        <thead>
            <tr>
                <th>Brand</th>
                <th>Model</th>
                <th>Image</th>
                <th></th>
            </tr>
        </thead>
        @foreach (var car in ViewBag.Cars)
        {
            <tr>
                <td>@car.manufacturer</td>
                <td>@car.model</td>
                <td><a href="@car.image"><img class="img-thumbnail" src="@car.image" style="width: 150px; height:100px;" /></a></td>
                <td><input type="radio" name="car" value="@car.id"/></td>
            </tr>
        }
    </table>
    <button type="submit">Reservar</button>
</form>